import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:xreader/app/app_routes.dart';
import 'package:xreader/app/sq_color.dart';
import 'package:xreader/binding/app_factory_bindings.dart';
import 'package:xreader/home/app_home.dart';
import 'package:xreader/service/book_service.dart';
import 'package:xreader/service/init_service.dart';

void main() {

  WidgetsFlutterBinding.ensureInitialized();
  runApp( GetMaterialApp(
    initialBinding: AppFactoryBindings(),
    home: const AppHome(),
    getPages:AppRoutes.appPages,
    debugShowCheckedModeBanner: false,
  ));
  if (Platform.isAndroid) {
    // 设置状态栏背景及颜色
    SystemUiOverlayStyle systemUiOverlayStyle =
    const SystemUiOverlayStyle(statusBarColor: Colors.transparent);
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
    // SystemChrome.setEnabledSystemUIOverlays([]); //隐藏状态栏
  }
  initGlobal();
}

initGlobal() {
  print("执行===初始化=====》");
  InitService.init();
}


